<template>
  <!-- 实验室检查 -->
  <section>
    <div>
    <el-date-picker
      v-model="startDate"
      type="date"
      @change="getData()"
      :picker-options="pickerOptions"
      value-format="yyyy-MM-dd"
      placeholder="开始日期">
    </el-date-picker>
    ----
    <el-date-picker
      v-model="endDate"
      type="date"
      @change="getData()"
      :picker-options="pickerBeginDateAfter"
      value-format="yyyy-MM-dd"
      placeholder="结束日期">
    </el-date-picker>
    </div>
    <div v-for="(item,index) in checkList" :key="index" class="laboratory_project_box">
      <div class="content-box">
        <el-row class="title">
          <!-- <el-col :span="12">{{item.checkDate}} - 复诊 - {{item.recheckMan}}</el-col> -->
          <el-col :span="12">{{item.checkDate}} - {{item.recheckMan}}</el-col>
          <el-col :span="12" style="text-align: right;">
            <i class="glyphicon glyphicon-pencil" style="cursor: pointer;"></i>
          </el-col>
        </el-row>
      </div>
      <!-- <ul class="nav_project">
        <li :class="{'active':flog==0}" @click="getLaboratory(0)">血脂四项</li>
        <li :class="{'active':flog==1}" @click="getLaboratory(1)">肝功十二项</li>
      </ul>-->
      <!-- <div>
        <el-row>
          <el-col class="laboratory_title" :span="24">血脂四项 - 10011128（10011128（ 未收费 ）</el-col>
        </el-row>
        <el-row class="laboratory_remark">
          <el-col :span="6">开单医生：李军</el-col>
          <el-col :span="6">开单时间：2019-07-15 09:11:23</el-col>
          <el-col :span="6">报告时间：2019-07-15 09:12</el-col>
          <el-col :span="6">报告人：李军</el-col>
        </el-row>
        <el-row class="alert-warning">
          <el-col :span="24">诊断：</el-col>
          <el-col :span="24">备注：1</el-col>
        </el-row>
        <el-row>
          <table border="0" class="table-box" width="100%">
            <thead>
              <tr>
                <th>序号</th>
                <th>项目</th>
                <th>检查结果</th>
                <th>单位</th>
                <th>性质</th>
                <th>参考范围</th>
              </tr>
            </thead>
            <tbody>
              <tr v-for="(item,index) in tableList" :key="index">
                <td>{{item.gmtCreate}}</td>
                <td>{{item.type | changeReocrd}}</td>
                <td>{{item.visitTime}}</td>
                <td>{{item.shouldMoney}}</td>
                <td>{{item.money}}</td>
                <td>{{item.discountMoney}}</td>
              </tr>
            </tbody>
          </table>
        </el-row>
      </div>-->
    </div>
  </section>
</template>
<script>
export default {
  props: ["detail"],
  data() {
    return {
      checkList: [],
      tableList: [],
      flog: 0,
      date: "",
      startDate: "2019-09-01",
      endDate: "2019-12-01",
      patientCard: "J02083530",
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now(); //如果没有后面的-8.64e7就是不可以选择今天的
        }
      },
      pickerBeginDateAfter: {
            disabledDate: (time) => {
               let beginDateVal = this.startDate;
               if (beginDateVal) {
                  return time.getTime() < beginDateVal;
               }
            }
         }
    };
  },
  mounted() {
    let th = this;
    th.getCheckList();
  },
  methods: {
    getLaboratory(type) {
      this.flog = type;
    },
    getCheckList() {
      let th = this;
      let j = {};
      // Object.assign(th.form,j)
      j.startDate = th.startDate;
      j.endDate = th.endDate;
      j.patientCard = th.patientCard;
      th.$api.findCheckListByLis(j).then(res => {
        if (res.executed) {
          th.checkList = res.data;
        }
      });
    },
    getData() {
      let th = this;
      if (th.date) {
        th.startDate = th.date[0];
        th.endDate = th.date[1];
        th.getCheckList();
      }
    }
  }
};
</script>
<style lang="scss" scoped>
@import "../_css/detail.scss";
@import "../_css/examine.scss";
.laboratory_project_box {
  border: none;
}
.visit_detail_box .content-box .title {
  background: none;
  padding-left: 0;
}
</style>